@echo off
:: 设置控制台为UTF-8编码
chcp 65001
echo Starting WeChat API Demo...

:: 设置JAVA_HOME
set "JAVA_HOME=D:\java"
set "PATH=%JAVA_HOME%\bin;%PATH%"

:: 检查Java版本
java -version
if %errorlevel% neq 0 (
    echo Error: Java not found!
    pause
    exit /b 1
)

:: 检查JAR文件
if not exist "target\gewei-demo-0.0.1-SNAPSHOT-jar-with-dependencies.jar" (
    echo Error: JAR file not found!
    echo Please run build.bat first!
    pause
    exit /b 1
)

:: 运行JAR
echo Running JAR file...
java -Dfile.encoding=UTF-8 -jar target/gewei-demo-0.0.1-SNAPSHOT-jar-with-dependencies.jar
pause 